// 面试 stl union 非POD类型的成员
#include <bits/stdc++.h>
using namespace std;

class Student {
 public:
  Student(bool g, int a) : gender(g), age(a) {}

 private:
  bool gender;
  int age;
};

union T {
  Student s;
  char name[10];
};

class B1 {
  static int n;
};
class B2 : B1 {
  int n1;
};
class B3 : B2 {
  static int n2;
};  // pod类型

int main() {
  printf("stu.size=%d\n", sizeof(Student));
  printf("T.size=%d\n", sizeof(T));
  // T t; // 构造失败，因为 Union 的构造函数被删除
  return 0;
}
